package dlally.view;

import dlally.model.DecisionLinesEvent;
import junit.framework.TestCase;
/**
 * Simple test for the construction of a GameFieldGUI to make sure that it can be created and set visible.
 * Also tests the handful of set/get methods that exist for the gui
 * @author Douglas Lally (dlally@wpi.edu)
 *
 */
public class testGameFieldGUI extends TestCase {
	/**
	 * This test case will need a model and an associated gui
	 */
	DecisionLinesEvent model;
	GameFieldGUI gui;

	/**
	 * Construct the model, gui, and set the gui's visibility to true
	 */
	protected void setUp() throws Exception {
		super.setUp();
		model = new DecisionLinesEvent(5,5);
		gui = new GameFieldGUI(model);
		gui.setVisible(true);

	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}
	/**
	 * Test the various set/get methods for the gui
	 */
	public void testGetSet(){
		assertFalse(gui.getIsMouseListenerActive());
		gui.enableMouseListener();
		assertTrue(gui.getIsMouseListenerActive());
		assertEquals(gui.choices, gui.getChoices());
		assertEquals(gui.choices[0], gui.getChoice(0));
		assertEquals(gui.lblDecisionLines, gui.getLabel());
		assertEquals(gui.gameField, gui.getPanel());
	}

}
